package com.faryangsh.enumpack;

import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by 杨志远 on 2017/8/24
 * email faryangsh@163.com.
 */

public class   EnumClass {
    public static void main(String[] args) throws Exception {
        Arrays.stream(Expoler.class.getGenericInterfaces()).forEach(System.out::println);
        System.out.println("-------------");
        Arrays.stream(Expoler.class.getMethods()).forEach(method -> {
            System.out.println(method.getName());
        });
        System.out.println("-------------");
        Arrays.stream(Enum.class.getMethods()).forEach(method -> {
            System.out.println(method.getName());
        });
        System.out.println("-------------");
        List<Method> explorMethod = Arrays.stream(Expoler.class.getMethods()).collect(Collectors.toList());
        List<Method> enumMethod = Arrays.stream(Enum.class.getMethods()).collect(Collectors.toList());
        explorMethod.removeAll(enumMethod);
        explorMethod.forEach(method -> System.out.println(method.getName()));
        System.out.println("-------------");
//        OSExecute.command("javap com.faryangsh.enumpack.Expoler");
        System.out.println("-------------");
        Expoler[] enumConstants = Expoler.class.getEnumConstants();
        System.out.println(enumConstants[1].name());
        Arrays.stream(enumConstants).forEach(expoler -> {
            if ("HERE is my".contains(expoler.name())){
                System.out.println(expoler.getName());
                System.out.println(expoler.getScore());
            }
        });
    }

}
